<template>
    <van-nav-bar
      :title="title"
      :left-text="hasBack?'返回':''"
      :left-arrow="hasBack"
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
  </template>
  
  <script>
  export default {
      name:"NavBack",
      props:{
          "title":String,
          "hasBack":{
              type:Boolean,
              default:true
          }
      },
      methods:{
          onClickLeft(){
              this.$router.back();
          },
          onClickRight(){
            this.$parent.onClickRight()
          }
      }
  };
  </script>
  
  <style>
  </style>